// const assert = require('assert')
const request = require('supertest')

const { testKoa } = require('../src/app')

describe('#http.test.js', () => {
  let server = testKoa().listen(9900)
  describe('#test server', () => {

    it('#test GET /', async () => {
      let res = await request(server)
        .get('/')
        .expect('Content-Type', /text\/html/)
        .expect(200, '<h1>Hello, world!</h1>')
    })

    it('#test GET /path?name=Bob', async () => {
      let res = await request(server)
        .get('/path?name=Bob')
        .expect('Content-Type', /text\/html/)
        .expect(200, '<h1>Hello, Bob!</h1>')
    })

  })
})
